import { createApp } from 'vue'
import App from './App.vue'
import router from './router'

// 导入全局样式表
import './assets/css/global.css'
// 导入vant的less样式变量
import 'vant/es/sidebar/style'
import 'vant/es/dialog/style'
import 'vant/es/toast/style'

import './api/request.js'

// 引入 vuex
import store from './store/index.js'

// 引入 echarts 核心模块，提供了 echarts 使用必须要的接口
import * as echarts from 'echarts/core'

// 引入提示框，标题，直角坐标系，数据集，内置数据转换器组件，组件后缀都为 Component
import {
    TitleComponent,
    TooltipComponent,
    GridComponent,
    DatasetComponent,
    TransformComponent
} from 'echarts/components'
// 标签自动布局、全局过渡动画等特性
import { LabelLayout, UniversalTransition } from 'echarts/features'
// 引入 Canvas 渲染器，引入 CanvasRenderer 或者 SVGRenderer 是必须的一步
import { CanvasRenderer } from 'echarts/renderers'

// 引入 echarts 折线图
import { LineChart } from 'echarts/charts'

// 注册必须的组件
echarts.use([
    TitleComponent,
    TooltipComponent,
    GridComponent,
    LineChart,
    DatasetComponent,
    TransformComponent,
    LabelLayout,
    UniversalTransition,
    CanvasRenderer
])

const app = createApp(App)

app.config.globalProperties.$echarts = echarts

app.use(router)
app.use(store)

app.mount('#app')